﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mimoza.Apps.Console.Commands;

namespace Mimoza.Apps.Console.ViewModel
{
    public class ToolBarViewModel : BaseViewModel
    {
        public IEnumerable<BaseConsoleCommand> GetToolBarCommands(int index) 
        {
            if (index == 0)
            {
                foreach (BaseConsoleCommand cmd in m_application.ContainersTreeViewModel.ToolBarCommands)
                {
                    yield return cmd; 
                }
            }
            else 
            {
                foreach (BaseConsoleCommand cmd in m_application.HostsViewModel.ToolBarCommands)
                {
                    yield return cmd;
                }
                foreach (BaseConsoleCommand cmd in m_application.PolicyViewModel.ToolBarCommands)
                {
                    yield return cmd;
                }
                foreach (BaseConsoleCommand cmd in m_application.UpdateViewModel.ToolBarCommands)
                {
                    yield return cmd;
                }
            }

            yield break;
        }
        public override IEnumerable<BaseConsoleCommand> ToolBarCommands
        {
            get { yield break; }            
        }
        public override IEnumerable<BaseConsoleCommand> ContextCommands
        {
            get { return m_application.ContainersTreeViewModel.ContextCommands; }
        }
    }
}
